<!--#include file="pj2.asp"-->
<!DOCTYPE html>
<html>

<head>
    <title>工单日志管理</title>
    <%
sessionExpire
easp.include "h.asp"
dim tn
tn="log1"
function conn_ms
	dim ms_c,ms_rs
	Easp.Db.SetConnection "ms", "MSSQL", "wz_1129", "sa:HKE1B5taA8F3kE6fWGATn2tBV9E45Y@(local)"
	Set ms_c =  Easp.Db.GetConnection("ms")
	dim ms_rs2,txt
	Set ms_rs2 = Easp.Db.Execute(ms_c, "select * from AKNnet_coms")
	txt=ms_rs2(1)
	'echo txt
	ms_rs2.close
	set ms_rs2=Nothing
end function
%>
</head>

<body>
    <div class="layui-fluid">
        <div class="layui-card"><br>
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <button type="button" class="layui-btn" lay-submit lay-filter="<%=tn%>_overtime_send">发消息</button>
                        <button type="button" class="layui-btn" lay-submit lay-filter="<%=tn%>_qmess2">刷新消息</button>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-card"><br>
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                        <div class="layui-form-item">
                            <label class="layui-form-label">搜索</label>
                            <div class="layui-input-inline">
                                <input type="text" name="sx1_input" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div><button type="button" class="layui-btn" lay-submit lay-filter="sx1">开始搜索</button>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <table id="<%=tn%>" lay-filter="<%=tn%>"></table><br></div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-card"><br>
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                        <div class="layui-form-item">
                            <label class="layui-form-label">搜索</label>
                            <div class="layui-input-inline">
                                <input type="text" name="sx2_input" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div><button type="button" class="layui-btn" lay-submit lay-filter="sx2">开始搜索</button>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <table id="<%=tn%>_qmess" lay-filter="<%=tn%>_qmess"></table><br>
                    </div>
                </div>
            </div>


            <div class="layui-col-md12">
                <div class="layui-card"><br>
                    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                        <div class="layui-form-item">
                            <label class="layui-form-label">搜索</label>
                            <div class="layui-input-inline">
                                <input type="text" name="sx3" placeholder="请输入" autocomplete="off" class="layui-input">
                            </div><button type="button" class="layui-btn" lay-submit lay-filter="sx3">开始搜索</button>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <table id="<%=tn%>1" lay-filter="<%=tn%>1"></table><br></div>
                </div>
                <%i_h "_id",""%>
            </div>
            <script src="/<%=rootpath%>/src/layuiadmin/layui/layui.js"></script>
            <script>
                layui.config({
                    base: '/<%=rootpath%>/src/layuiadmin/'
                }).extend({
                    index: 'lib/index' //主入口模块
                }).use(['index', 'console', 'useradmin', 'table', 'laydate'], function() {
                    var $ = layui.$,
                        laydate = layui.laydate,
                        form = layui.form,
                        admin = layui.admin,
                        table = layui.table;

                    form.on('submit(sx1)', function(data) {
                        var field = data.field;
                        table.reload('<%=tn%>', {
                            where: field
                        });
                        layer.msg('已刷新sx1');
                    });
                    form.on('submit(sx2)', function(data) {
                        var field = data.field;
                        alert('<%=tn%>_qmess');
                        table.reload('<%=tn%>_qmess', {
                            where: field
                        });
                        layer.msg('已刷新sx2');
                    });

                    //监听行单击事件（双击事件为：rowDouble）
                    table.on('row(<%=tn%>)', function(obj) {
                        var data = obj.data;
                        /*layer.alert(JSON.stringify(data), {
                          title: '当前行数据：'
                        });*/

                        $("#_id").val(data.mobile);
                        obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
                    });
                    laydate.render({
                        elem: '#sd',
                        value: '<%=Format_Time(now()-10,2)%>'
                    });
                    laydate.render({
                        elem: '#ed',
                        value: '<%=Format_Time(now()-3,2)%>'
                    });
                    form.render();
                    table.render({
                        elem: '#<%=tn%>',
                        url: 'pjson.asp?action=<%=tn%>_overtime_l',
                        cols: [
                            [
                                //{type:'checkbox'},		
                                <%
		g_tbf "truename,cnt,mobile","接单人,数量:80,手机:150"
		%> {
                                    fixed: 'right',
                                    width: 80,
                                    align: 'center',
                                    toolbar: '#barDemo'
                                }
                            ]
                        ],
                        id: '<%=tn%>',
                        limit: 10,
                        page: true,
                        height: 275
                    });
                    table.render({
                        elem: '#<%=tn%>',
                        url: 'pjson.asp?action=<%=tn%>_overtime_l',
                        cols: [
                            [{
                                    type: 'checkbox'
                                },
                                <%
		g_tbf "truename,cnt:80,mobile:120","接单人,数量,手机"
		%> {
                                    fixed: 'right',
                                    width: 80,
                                    align: 'center',
                                    toolbar: '#barDemo'
                                }
                            ]
                        ],
                        id: '<%=tn%>',
                        limit: 10,
                        page: true,
                        height: 275
                    });

                    table.render({
                        elem: '#<%=tn%>1',
                        url: 'pjson.asp?action=<%=tn%>_qmess' + "&need_mysql=1", //&super=1
                        cols: [
                            [
                                //{type:'checkbox'},		
                                <%
		g_tbf "id,date:120,mess_text:300,phone:150","序号,日期,信息内容,号码"
		%>
                            ]
                        ],
                        id: '<%=tn%>',
                        limit: 10,
                        page: true,
                        height: 275
                    });

                    table.render({
                        elem: '#<%=tn%>_qmess',
                        url: 'pjson.asp?action=<%=tn%>_qmess' + "&need_mysql=1",
                        cols: [
                            [
                                //{type:'checkbox'},		
                                <%
		g_tbf "id,date:120,mess_text:300,phone:150","序号,日期,信息内容,号码"
		%>
                            ]
                        ],
                        id: '<%=tn%>',
                        limit: 10,
                        page: true,
                        height: 275
                    });

                    form.on('submit(<%=tn%>_search)', function(data) {
                        var field = data.field;
                        table.reload('<%=tn%>', {
                            where: field
                        });
                        layer.msg('已刷新');
                    });

                    form.on('submit(<%=tn%>_overtime_send)', function(data) {
                        $.post('pjson.asp?now=' + new Date().getTime() + "&need_mysql=1", {
                                action: "<%=tn%>_overtime_send"
                            },
                            function(data) {
                                var jsonObj = $.parseJSON(data);
                                layer.msg(jsonObj.msg);
                            });
                    });
                    table.on('tool(<%=tn%>)',
                        function(obj) {
                            var data = obj.data;
                            if (obj.event === '<%=tn%>_overtime_send') {
                                var _this = $(this);
                                alert(data.mobile);
                                table.reload('<%=tn%>');
                            }

                        });
                });
            </script>
</body>

</html>